package com.gopay.common.domain.cps;

import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

@Entity
@Table(name = "CPS_GEN_MAIN_ORDER")
public class CpsGenMainOrder extends BaseEntity {
   
    private static final long serialVersionUID = 5397626784953630121L;
    private String gopayOrderId;
    private int version;
    private int transDtlSq;
    private String gopayIntTxnCd;
    private String merId;
    private String merOrderId;
    private Date merTxnTm;
    private String gatewaySource;
    private String gatewayChannel;
    private String orderType;
    private String payChannel;
    private Date gopayTxnTm;
    private String relevanceGopayOrderId;
    private BigDecimal totalOrderAmt;
    private BigDecimal totalOrderFeeAmt;
    private BigDecimal orderDealAmt;
    private BigDecimal orderRealFeeAmt;
    private String orderFeePayer;
    private String curType;
    private String mainRecvAcct;
    private String mainRecvAcctProdCode;
    private String mainRecvAcctProdName;
    private String mainRecvCustId;
    private String payAcct;
    private String mainPayAcctProdCode;
    private String mainPayAcctProdName;
    private String payCustId;
    private int txnStaCd;
    private String outStlmId;
    private String outPayAcct;
    private Date tranFinishTime;
    private Date orderStlmTime;
    private Date createdTs;
    private Date lastUpdTs;
    private String lastUpdTrancode;
    private String remark1;
    private String remark2;
    private BigDecimal merTxnAmt;
    private String accountPoint;
    private String userId;
    private int reversalFlag = 100;
    private String childTranType;
    private BigDecimal merCommAmt;
    private String merCommPayer;
    private String errCode;
    private String errMsg;   //保存bis响应的订单错误描述 add by liuyong 20170216
    private String processCode;
    /**
     * E键支付00700-收款订单支付渠道
     */
    private String remark3;
    private String otherAcct;
    
    /**
     * 结算金额  ZZG  如果不清楚请联系ZZG,LZ了解，请勿随便塞值
     * 如果是付款方承担手续费 并且 订单与银行有关
     * 
     *	 结算统计金额：
		收款类：网银，快捷承担方为付款方：(主要是充值和网关支付)
		结算统计金额=商户交易金额+手续费
		付款类：（付款到银行和提现属于此类）
		结算统计金额=商户交易金额
     * 
     * 
     */
    private BigDecimal settleAmt;
//    //非库字段
//    //交易总笔数
//    private long tranSum;

    private String remoteIp;//远程IP地址
    
    @Id
    @Column(name = "GOPAY_ORDER_ID", unique = true, nullable = false, length = 30)
    public String getGopayOrderId() {
        return this.gopayOrderId;
    }

    public void setGopayOrderId(String gopayOrderId) {
        this.gopayOrderId = gopayOrderId;
    }

    @Column(name = "OTHER_ACCT", length = 19)
    public String getOtherAcct() {
        return otherAcct;
    }

    public void setOtherAcct(String otherAcct) {
        this.otherAcct = otherAcct;
    }


    @Column(name = "TRANS_DTL_SQ", nullable = false, precision = 22, scale = 0)
    public int getTransDtlSq() {
        return this.transDtlSq;
    }

    public void setTransDtlSq(int transDtlSq) {
        this.transDtlSq = transDtlSq;
    }

    @Column(name = "GOPAY_INT_TXN_CD", nullable = false, length = 6)
    public String getGopayIntTxnCd() {
        return this.gopayIntTxnCd;
    }

    public void setGopayIntTxnCd(String gopayIntTxnCd) {
        this.gopayIntTxnCd = gopayIntTxnCd;
    }

    @Column(name = "MER_ID", nullable = false, length = 10)
    public String getMerId() {
        return this.merId;
    }

    public void setMerId(String merId) {
        this.merId = merId;
    }

    @Column(name = "MER_ORDER_ID", nullable = false)
    public String getMerOrderId() {
        return this.merOrderId;
    }

    public void setMerOrderId(String merOrderId) {
        this.merOrderId = merOrderId;
    }

    @Column(name = "MER_TXN_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getMerTxnTm() {
        return this.merTxnTm;
    }

    public void setMerTxnTm(Date merTxnTm) {
        this.merTxnTm = merTxnTm;
    }

    @Column(name = "GATEWAY_SOURCE", nullable = false, length = 2)
    public String getGatewaySource() {
        return this.gatewaySource;
    }

    public void setGatewaySource(String gatewaySource) {
        this.gatewaySource = gatewaySource;
    }

    @Column(name = "GATEWAY_CHANNEL", nullable = false, length = 2)
    public String getGatewayChannel() {
        return this.gatewayChannel;
    }

    public void setGatewayChannel(String gatewayChannel) {
        this.gatewayChannel = gatewayChannel;
    }

    @Column(name = "ORDER_TYPE", nullable = false, length = 2)
    public String getOrderType() {
        return this.orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    @Column(name = "PAY_CHANNEL", length = 2)
    public String getPayChannel() {
        return this.payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    @Column(name = "GOPAY_TXN_TM", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getGopayTxnTm() {
        return this.gopayTxnTm;
    }

    public void setGopayTxnTm(Date gopayTxnTm) {
        this.gopayTxnTm = gopayTxnTm;
    }

    @Column(name = "RELEVANCE_GOPAY_ORDER_ID", length = 30)
    public String getRelevanceGopayOrderId() {
        return this.relevanceGopayOrderId;
    }

    public void setRelevanceGopayOrderId(String relevanceGopayOrderId) {
        this.relevanceGopayOrderId = relevanceGopayOrderId;
    }

    @Column(name = "TOTAL_ORDER_AMT", nullable = false, precision = 20)
    public BigDecimal getTotalOrderAmt() {
        return this.totalOrderAmt;
    }

    public void setTotalOrderAmt(BigDecimal totalOrderAmt) {
        this.totalOrderAmt = totalOrderAmt;
    }

    @Column(name = "TOTAL_ORDER_FEE_AMT", nullable = false, precision = 20)
    public BigDecimal getTotalOrderFeeAmt() {
        return this.totalOrderFeeAmt;
    }

    public void setTotalOrderFeeAmt(BigDecimal totalOrderFeeAmt) {
        this.totalOrderFeeAmt = totalOrderFeeAmt;
    }

    @Column(name = "ORDER_DEAL_AMT", nullable = false, precision = 20)
    public BigDecimal getOrderDealAmt() {
        return this.orderDealAmt;
    }

    public void setOrderDealAmt(BigDecimal orderDealAmt) {
        this.orderDealAmt = orderDealAmt;
    }

    @Column(name = "ORDER_REAL_FEE_AMT", nullable = false, precision = 20)
    public BigDecimal getOrderRealFeeAmt() {
        return this.orderRealFeeAmt;
    }

    public void setOrderRealFeeAmt(BigDecimal orderRealFeeAmt) {
        this.orderRealFeeAmt = orderRealFeeAmt;
    }

    @Column(name = "ORDER_FEE_PAYER", nullable = true, length = 1)
    public String getOrderFeePayer() {
        return this.orderFeePayer;
    }

    public void setOrderFeePayer(String orderFeePayer) {
        this.orderFeePayer = orderFeePayer;
    }

    @Column(name = "CUR_TYPE", nullable = false, length = 3)
    public String getCurType() {
        return this.curType;
    }

    public void setCurType(String curType) {
        this.curType = curType;
    }

    @Column(name = "MAIN_RECV_ACCT", length = 19)
    public String getMainRecvAcct() {
        return this.mainRecvAcct;
    }

    public void setMainRecvAcct(String mainRecvAcct) {
        this.mainRecvAcct = mainRecvAcct;
    }

    @Column(name = "MAIN_RECV_ACCT_PROD_CODE", length = 10)
    public String getMainRecvAcctProdCode() {
        return this.mainRecvAcctProdCode;
    }

    public void setMainRecvAcctProdCode(String mainRecvAcctProdCode) {
        this.mainRecvAcctProdCode = mainRecvAcctProdCode;
    }

    @Column(name = "MAIN_RECV_ACCT_PROD_NAME", length = 20)
    public String getMainRecvAcctProdName() {
        return this.mainRecvAcctProdName;
    }

    public void setMainRecvAcctProdName(String mainRecvAcctProdName) {
        this.mainRecvAcctProdName = mainRecvAcctProdName;
    }

    @Column(name = "MAIN_RECV_CUST_ID", length = 10)
    public String getMainRecvCustId() {
        return this.mainRecvCustId;
    }

    public void setMainRecvCustId(String mainRecvCustId) {
        this.mainRecvCustId = mainRecvCustId;
    }

    @Column(name = "PAY_ACCT", length = 19)
    public String getPayAcct() {
        return this.payAcct;
    }

    public void setPayAcct(String payAcct) {
        this.payAcct = payAcct;
    }

    @Column(name = "MAIN_PAY_ACCT_PROD_CODE", length = 10)
    public String getMainPayAcctProdCode() {
        return this.mainPayAcctProdCode;
    }

    public void setMainPayAcctProdCode(String mainPayAcctProdCode) {
        this.mainPayAcctProdCode = mainPayAcctProdCode;
    }

    @Column(name = "MAIN_PAY_ACCT_PROD_NAME", length = 20)
    public String getMainPayAcctProdName() {
        return this.mainPayAcctProdName;
    }

    public void setMainPayAcctProdName(String mainPayAcctProdName) {
        this.mainPayAcctProdName = mainPayAcctProdName;
    }

    @Column(name = "PAY_CUST_ID", length = 10)
    public String getPayCustId() {
        return this.payCustId;
    }

    public void setPayCustId(String payCustId) {
        this.payCustId = payCustId;
    }

    

    @Column(name = "OUT_STLM_ID", length = 10)
    public String getOutStlmId() {
        return this.outStlmId;
    }

    public void setOutStlmId(String outStlmId) {
        this.outStlmId = outStlmId;
    }

    @Column(name = "OUT_PAY_ACCT", length = 30)
    public String getOutPayAcct() {
        return this.outPayAcct;
    }

    public void setOutPayAcct(String outPayAcct) {
        this.outPayAcct = outPayAcct;
    }

    @Column(name = "TRAN_FINISH_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getTranFinishTime() {
        return this.tranFinishTime;
    }

    public void setTranFinishTime(Date tranFinishTime) {
        this.tranFinishTime = tranFinishTime;
    }

    @Column(name = "ORDER_STLM_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    public Date getOrderStlmTime() {
        return this.orderStlmTime;
    }

    public void setOrderStlmTime(Date orderStlmTime) {
        this.orderStlmTime = orderStlmTime;
    }

    @Column(name = "CREATED_TS", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getCreatedTs() {
        return this.createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name = "LAST_UPD_TS", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    public Date getLastUpdTs() {
        return this.lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Column(name = "LAST_UPD_TRANCODE", length = 10)
    public String getLastUpdTrancode() {
        return this.lastUpdTrancode;
    }

    public void setLastUpdTrancode(String lastUpdTrancode) {
        this.lastUpdTrancode = lastUpdTrancode;
    }
    
    @Version
    @Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
    public int getVersion() {
        return this.version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Column(name = "REMARK1", length = 50)
    public String getRemark1() {
        return this.remark1;
    }

    public void setRemark1(String remark1) {
        this.remark1 = remark1;
    }

    @Column(name = "REMARK2", length = 50)
    public String getRemark2() {
        return this.remark2;
    }

    public void setRemark2(String remark2) {
        this.remark2 = remark2;
    }

    @Column(name = "REMARK3", length = 50)
    public String getRemark3() {
        return this.remark3;
    }

    public void setRemark3(String remark3) {
        this.remark3 = remark3;
    }
    
    @Column(name = "ACCOUNTING_POINT", length = 3)
    public String getAccountPoint() {
        return accountPoint;
    }

    public void setAccountPoint(String accountPoint) {
        this.accountPoint = accountPoint;
    }

    @Column(name = "MER_TXN_AMT", precision = 20)
    public BigDecimal getMerTxnAmt() {
        return merTxnAmt;
    }

    public void setMerTxnAmt(BigDecimal merTxnAmt) {
        this.merTxnAmt = merTxnAmt;
    }

    @Column(name="PROCESS_CODE", length=10)
	public String getProcessCode() {
		return processCode;
	}

	public void setProcessCode(String processCode) {
		this.processCode = processCode;
	}
    
    @Column(name = "TXN_STA_CD", nullable = false, length = 2)
    public int getTxnStaCd() {
        return this.txnStaCd;
    }

    public void setTxnStaCd(int txnStaCd) {
        this.txnStaCd = txnStaCd;
    }

    @Column(name = "REVERSAL_FLAG", length = 3)
    public int getReversalFlag() {
        return reversalFlag;
    }

    public void setReversalFlag(int reversalFlag) {
        this.reversalFlag = reversalFlag;
    }

    @Column(name = "USER_ID", length = 10)
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Column(name = "CHILD_TRAN_TYPE", length = 6)
    public String getChildTranType() {
        return childTranType;
    }

    public void setChildTranType(String childTranType) {
        this.childTranType = childTranType;
    }

    @Column(name="MER_COMM_AMT", precision=20, scale=2)
    public BigDecimal getMerCommAmt() {
        return this.merCommAmt;
    }

    public void setMerCommAmt(BigDecimal merCommAmt) {
        this.merCommAmt = merCommAmt;
    }

    @Column(name="MER_COMM_PAYER", length=2)
    public String getMerCommPayer() {
        return this.merCommPayer;
    }

    public void setMerCommPayer(String merCommPayer) {
        this.merCommPayer = merCommPayer;
    }

    @Column(name="ERR_CODE", length=10)
    public String getErrCode() {
        return errCode;
    }

    public void setErrCode(String errCode) {
        this.errCode = errCode;
    }
    @Column(name = "SETTLE_AMT", precision = 20)
   	public BigDecimal getSettleAmt() {
   		return settleAmt;
   	}

   	public void setSettleAmt(BigDecimal settleAmt) {
   		this.settleAmt = settleAmt;
   	}

    @Column(name="REMOTE_IP", length=20)
    public String getRemoteIp() {
        return remoteIp;
    }

    public void setRemoteIp(String remoteIp) {
        this.remoteIp = remoteIp;
    }
    
	

    @Column(name="ERR_MSG", length=100)
    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }



    //	public long getTranSum() {
	
//	public long getTranSum() {
//		return tranSum;
//	}
//
//	public void setTranSum(long tranSum) {
//		this.tranSum = tranSum;
//	}
}
